package com.abl.manage.controller.mt;

import com.abl.core.domain.db.MtRoomApply;
import com.abl.core.domain.mt.MtRoomApplyVo;
import com.abl.core.domain.project.PageSearch;
import com.abl.core.domain.project.SRS;
import com.abl.core.service.mt.MtRoomService;
import com.mybatisflex.core.paginate.Page;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 申请审批
 */
@RestController
@RequestMapping("/manage/mt/apply")
public class MtApplyC {
    @Resource
    private MtRoomService mtRoomService;

    //查询申请记录
    @PostMapping("/page")
    public SRS<Page<MtRoomApplyVo>> page(MtRoomApplyVo mtRoomApply, PageSearch pageSearch) {
        return SRS.bySuccess(mtRoomService.page(mtRoomApply, pageSearch));
    }

    /**
     * 审批申请
     */
    @PostMapping("/approve")
    public SRS<Object> approve(MtRoomApply mtRoomApply) {
        return SRS.bySuccess(mtRoomService.approve(mtRoomApply));
    }


}
